

public class MyList {

	MyNode nFirst, nLast;
	int iTotal;

	public MyList() {

		nFirst = nLast = null;
		iTotal = 0;

	}

	public void insertAtStart(Object oValue) {
		iTotal++;
		MyNode nNode = new MyNode(oValue);
		if (nFirst == null) {
			nFirst = nNode;
			nLast = nFirst;
		} else {
			nNode.nRight = nFirst;
			nFirst = nNode;
		}
	}

	public void insertAtEnd(Object oValue) {
		iTotal++;
		MyNode nNode = new MyNode(oValue);
		if (nLast == null) {
			nLast = nNode;
			nFirst = nLast;
		} else {
			nLast.nRight = nNode;
			nLast = nNode;

		}
	}

	public void searchNode(Object oValue) {
		MyNode tempNode = nFirst;

		while (tempNode != null) {
			if (tempNode.oValue == oValue) {
				System.out.println("o valor ");
				break;
			} else {
				tempNode = tempNode.nRight;
			}
		}
	}
}
